package playlist;

import java.io.IOException;
import java.util.Enumeration;

import javax.microedition.io.Connector;
import javax.microedition.io.file.FileConnection;

import tool.Path;


public class NowPlaylist extends Playlist {
	
	public NowPlaylist(String type, String dir) {
		super(type, dir);
	}

	public String getType() {
		return type;
	}

	public String getDir() {
		return dir;
	}

	public int getSize() {
		return size;
	}

	protected void calculateSize() throws IOException {
		FileConnection connection = (FileConnection) Connector.open(
			Path.NOW);
		Enumeration files = connection.list("*.link", true);
		int index = 0;

		while (files.hasMoreElements()) {
			String mp3 = (String) files.nextElement();
			index++;
		}
		connection.close();
		size = index;
	}
}
